<template>
  <div class="w">
    <div class="bj2"></div>
    <div class="bj1"></div>
    <div class="bear"></div>
  </div>
</template>

<script>
export default {}
</script>

<style lang="scss" scoped>
.w {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: rgba(137, 207, 235, 0.5);
}

.bj1 {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 336px;
  background-image: url(../assets/animation/bg1.png);
  animation: movemo 15s linear infinite;
}

.bj2 {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 569px;
  background-image: url(../assets/animation/bg2.png);
  animation: movemo 18s linear infinite;
}

.bear {
  position: absolute;
  width: 200px;
  height: 100px;
  bottom: 50px;
  background: url(../assets/animation/bear.png) no-repeat;
  animation: bear 1s steps(8) infinite, move 3s forwards;
}

@keyframes movemo {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: -3840px 0;
  }
}

@keyframes bear {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: -1600px 0;
  }
}

@keyframes move {
  0% {
    left: 0;
  }
  100% {
    left: 50%;
    transform: translate(-50%, 0);
  }
}
</style>